home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-11 | 7.4 KB | 166 lines | [TEXT/R*ch] |
- `global procedure DBDiagnostics
- `DBDiagnostics allows a user to examine information regarding the
- `4D database.
-
- C_TEXT(vSubmit;vFileNum;vFieldNum)
- C_TEXT($FileList;$FieldList;$RFieldList)
- C_STRING(40;$FieldType)
- C_STRING(15;$FieldName;$FileName)
-
- READ ONLY(*)
-
- DBDHeader
-
- NL_GetField (vReqID;"submit";vSubmit)
- NL_GetField (vReqID;"File Number";vFileNum)
- NL_GetField (vReqID;"Field Number";vFieldNum)
-
- `Have we been asked to reset the display?
- Case of
- : (vSubmit="Show Database Only")
- vFileNum:=""
- vFieldNum:=""
- : ((vSubmit="Show Database and File Only") | (vSubmit="File Information"))
- vFieldNum:=""
- End case
-
- `Are we scanning the files?
- Case of
- : (vSubmit="First File")
- vFileNum:="1"
- vFieldNum:=""
- : (vSubmit="Previous File")
- If (Num(vFileNum)>1)
- vFileNum:=String(Num(vFileNum)-1)
- Else
- vFileNum:="1"
- End if
- vFieldNum:=""
- : (vSubmit="Next File")
- If (Num(vFileNum)<Count files)
- vFileNum:=String(Num(vFileNum)+1)
- Else
- vFileNum:=String(Count files)
- End if
- vFieldNum:=""
- : (vSubmit="Last File")
- vFileNum:=String(Count files)
- vFieldNum:=""
- End case
-
- `Are we scanning the fields?
- Case of
- : (vSubmit="First Field")
- vFieldNum:="1"
- : (vSubmit="Previous Field")
- If (Num(vFieldNum)>1)
- vFieldNum:=String(Num(vFieldNum)-1)
- Else
- vFieldNum:="1"
- End if
- : (vSubmit="Next Field")
- If (Num(vFieldNum)<Count fields(Num(vFileNum)))
- vFieldNum:=String(Num(vFieldNum)+1)
- Else
- vFieldNum:=String(Count fields(Num(vFileNum)))
- End if
- : (vSubmit="Last Field")
- vFieldNum:=String(Count fields(Num(vFileNum)))
- End case
-
- `The top section of this form contains general database information.
- NL_AppendReply (vReqID;"<h2 align=center>General Database Information</h2>")
-
- GeneralDBInfo
-
- NL_AppendReply (vReqID;"The database is comprised of <strong>"+String(Count files)+"</strong> files and their names are:<br>")
-
- `The HTML form begins here.
- NL_AppendReply (vReqID;"<form method="+◊quote+"post"+◊quote+" action="+◊quote+"/4D.acgi$DBDiagnostics"+◊quote+">")
- NL_AppendReply (vReqID;"<center>")
- If (vFileNum="")
- NL_AppendReply (vReqID;DBFileList ("File Number";True;"";7;False)+"<br>")
- Else
- NL_AppendReply (vReqID;DBFileList ("File Number";True;Filename(Num(vFileNum));7;False)+"<br>")
- End if
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"File Information"+◊quote+"><br>")
- NL_AppendReply (vReqID;"</center>")
- NL_AppendReply (vReqID;"<hr><p>")
-
- `The next section of the form contains information about a specific file
- `in the database.
- If ((vSubmit="File Information") | (vFileNum#""))
-
- NL_AppendReply (vReqID;"<h3 align=center>Information Regarding File "+◊quote+Filename(Num(vFileNum))+◊quote+"</h3>")
-
- GeneralFileInfo (Num(vFileNum))
-
- NL_AppendReply (vReqID;"The file is comprised of <strong>"+String(Count fields(Num(vFileNum)))+"</strong> fields and their names are:<br>")
- NL_AppendReply (vReqID;"<center>")
- If (vFieldNum="")
- NL_AppendReply (vReqID;DBFieldNameList (Num(vFileNum);"Field Number";True;"";7;False)+"<br>")
- Else
- NL_AppendReply (vReqID;DBFieldNameList (Num(vFileNum);"Field Number";True;Fieldname(Num(vFileNum);Num(vFieldNum));7;False)+"<br>")
- End if
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Field Information"+◊quote+"><br>")
-
- If (Count files>1)
- Case of
- : (Num(vFileNum)=1)
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next File"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last File"+◊quote+"><br>")
- : (Num(vFileNum)=Count files)
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First File"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous File"+◊quote+"><br>")
- Else
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First File"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous File"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next File"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last File"+◊quote+"><br>")
- End case
- End if `Count files>1
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Show Database Only"+◊quote+"><br>")
- NL_AppendReply (vReqID;"</center>")
-
- NL_AppendReply (vReqID;"<hr><p>")
-
- `The next section of the form contains information about a specific field
- `within a specific file in the database.
- If ((vSubmit="Field Information") | (vFieldNum#""))
-
- $FileName:=Filename(Num(vFileNum))
- $FieldName:=Fieldname(Num(vFileNum);Num(vFieldNum))
- NL_AppendReply (vReqID;"<h3 align=center>Information Regarding Field "+◊quote+$FieldName+◊quote+" in File "+◊quote+$FileName+◊quote+"</h3>")
-
- FieldAttributes (Num(vFileNum);Num(vFieldNum))
-
- NL_AppendReply (vReqID;"<center>")
- If (Count fields(Num(vFileNum))>1)
- NL_AppendReply (vReqID;"<br>")
- Case of
- : (Num(vFieldNum)=1)
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next Field"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last Field"+◊quote+"><br>")
- : (Num(vFieldNum)=Count fields(Num(vFileNum)))
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First Field"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous Field"+◊quote+"><br>")
- Else
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First Field"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous Field"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next Field"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last Field"+◊quote+"><br>")
- End case
- End if `Count fields>1
-
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Show Database Only"+◊quote+">")
- NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Show Database and File Only"+◊quote+"><br>")
- NL_AppendReply (vReqID;"</center>")
-
- End if `vSubmit="Field Information"
- End if `vSubmit="File Information"
-
- NL_AppendReply (vReqID;"<input type="+◊quote+"reset"+◊quote+" value="+◊quote+"Reset"+◊quote+">")
- NL_AppendReply (vReqID;"</form>")
-
- DBDFooter
-